<div class="accordion-group" style="margin: 0px 80px 0px 80px;border:0">
    <input type="hidden">
    <div class="accordion-body" style="overflow: visible;">
        <div class="accordion-inner " style="padding: 0px 0px 0px 0px;border:0">
            <div class="control-group form-horizontal" style="margin: 0 0 0 0;">
                <table class="table table-attribute-property">
                    <tbody class="basic">
                    <tr class="fixed">
                        <td>name</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off" disabled>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>type</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>multiplicity</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>visibility</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>default</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>constraint</td>
                        <td>
                            <div class="control-sub" >
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    </tbody>
                    <tbody class="additional">
                    <tr style="display: none">
                        <td>ordering</td>
                        <td>
                            <div class="control-sub" >
                                <label class="radio inline"><input type="radio" value="True" >True</label>
                                <label class="radio inline"><input type="radio" value="False">False</label>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>uniqueness</td>
                        <td>
                            <div class="control-sub" >
                                <label class="radio inline"><input type="radio" value="True" >True</label>
                                <label class="radio inline"><input type="radio" value="False">False</label>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>readOnly</td>
                        <td>
                            <div class="control-sub" >
                                <label class="radio inline"><input type="radio" value="True" >True</label>
                                <label class="radio inline"><input type="radio" value="False">False</label>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>union</td>
                        <td>
                            <div class="control-sub">
                                <label class="radio inline"><input type="radio" value="True" >True</label>
                                <label class="radio inline"><input type="radio" value="False">False</label>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>subsets</td>
                        <td>
                            <div class="control-sub">
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>redefines</td>
                        <td>
                            <div class="control-sub">
                                <input type="text" class="miniInput search-attributeElem" data-provide="typeahead" data-items="10" autocomplete="off">
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none">
                        <td>composite</td>
                        <td>
                            <div class="control-sub">
                                <label class="radio inline"><input type="radio" value="True" >True</label>
                                <label class="radio inline"><input type="radio" value="False">False</label>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <!--div class='text-center additional' style="margin-top: -15px;margin-bottom: 5px"><span class="remove-input " ><i class="icon-plus-sign" title="Additional"></i></span></div-->
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(function(){
        $(".search-attributeElem").typeahead({
            source:function(query, process){
                //alert($("#modal-attribute-add-multi").find("input[type='text']:focus").length);
                //alert($("#modal-create-attribute").find("input[type='text']:focus").length);
                var item;
                if($("#modal-attribute-add-multi").find("input[type='text']:focus").length === 1){
                    item = $("#modal-attribute-add-multi").find("input[type='text']:focus");
                    var attributeElem = $(item).parent().parent().parent().children("td").eq(0).text();
                    attributeElem = chToEn[attributeElem];
                    process(getTypeaHead(attributeElem));
                }

                else{
                    item = $("#modal-create-attribute").find("input[type='text']:focus");
                    var attributeElem = $(item).parent().parent().parent().children("td").eq(0).text();
                    attributeElem = chToEn[attributeElem];
                    if(attributeElem==='name')  attributeElem ='attribute';

                    switch(attributeElem){
                        case 'attribute':
                            process(getTypeaHead(attributeElem));
                            break;
                        case 'type':
                            var legalList = {};
                            var array = [];
                            for(var i=0;i<m_attribute.type.length;i++){
                                legalList[m_attribute.type[i]] = 1;
                                array.push([m_attribute.type[i],1]);
                            }
                            for(var id in icd.class){
                                for(var name in icd.class[id].name){
                                    if(legalList[name] === undefined){
                                        legalList[name] = 1;
                                        array.push([name,1]);
                                    }
                                }
                            };
                            process(uniqueArray(array));
                            break;
                        case 'visibility':
                            process(['private','protected','public','package']);
                            break;
                    }
                }

            }
            //menu: '<ul style="margin-left:10px;min-width:220px" class="typeahead dropdown-menu"></ul>',
            //item: '<li style="min-width:220px"><a href="#"></a></li>'
        });
    });
</script>